Skip to content

libstore/http-binary-cache-store: Improve error messages in HttpBinar…#14406

Merged
xokdvium merged 1 commit intomasterfrom
better-error-message
Oct 29, 2025
Merged

libstore/http-binary-cache-store: Improve error messages in HttpBinar…#14406
xokdvium merged 1 commit intomasterfrom
better-error-message

Conversation

@xokdvium
Copy link
Contributor

…yCacheStore::upsertFile

Motivation

Now the error message doesn't cram everything into a single line and we now instead get:

error:
       … while uploading to HTTP binary cache at 's3://my-cache?endpoint=http://localhost:9000?compression%3Dzstd&region=eu-west-1'

       error: unable to download 'http://localhost:9000/my-cache/nar/1125zqba8cx8wbfa632vy458a3j3xja0qpcqafsfdildyl9dqa7x.nar.xz': Operation was aborted by an application callback (42)

Context

Noticed while doing #14390.


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

…yCacheStore::upsertFile

Now the error message doesn't cram everything into a single line and we now instead get:

error:
       … while uploading to HTTP binary cache at 's3://my-cache?endpoint=http://localhost:9000?compression%3Dzstd&region=eu-west-1'

       error: unable to download 'http://localhost:9000/my-cache/nar/1125zqba8cx8wbfa632vy458a3j3xja0qpcqafsfdildyl9dqa7x.nar.xz': Operation was aborted by an application callback (42)
@xokdvium xokdvium requested a review from Ericson2314 as a code owner October 28, 2025 23:06
@github-actions github-actions bot added the store Issues and pull requests concerning the Nix store label Oct 28, 2025
getFileTransfer()->upload(req);
} catch (FileTransferError & e) {
throw UploadToHTTP("while uploading to HTTP binary cache at '%s': %s", config->cacheUri.to_string(), e.msg());
UploadToHTTP err(e.message());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note the .message() here. It's to ensure that we don't get the error: prefix twice.

@xokdvium xokdvium requested a review from lovesegfault October 28, 2025 23:11
@xokdvium xokdvium added this pull request to the merge queue Oct 29, 2025
Merged via the queue into master with commit e08853a Oct 29, 2025
21 checks passed
@xokdvium xokdvium deleted the better-error-message branch October 29, 2025 04:03
@edolstra edolstra mentioned this pull request Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

store Issues and pull requests concerning the Nix store

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants